const path = require("path");

module.exports = {
	// host: '127.0.0.1',
	port: 9002,
	hot: true,
	open: true,
	client: {
		overlay: {
			errors: false,
			warnings: false,
		},
	},
	setupExitSignals: true, // 允许在 SIGINT 和 SIGTERM 信号时关闭开发服务器和退出进程。
	compress: false, // gzip压缩,开发环境不开启,提升热更新速度
	historyApiFallback: true, // 解决history路由404问题
	static: {
		directory: path.join(__dirname, "../../public"), // 托管静态资源public文件夹
	},
	headers: { "Access-Control-Allow-Origin": "*" },
	proxy: {
		'/api': {
			target: 'https://restapi.amap.com',
			changeOrigin: true,
			pathRewrite: { '^/api': '' },
		},
	},
};
